<template>
	<view>
		<my-animation :share="share" @display="display" :height="height">
			<template v-slot:spOne>
				<view class="box">
					<view class="top">
						<view class="remove">
							<image :src="removeImg" @click="display"></image>
						</view>
						<view class="price">
							<text class="bq">￥</text>
							<text class="price-text">{{orderAllPrice}}</text>
						</view>
					</view>
					<view class="center">
						<radio-group @change="changeRadio">
							<view class="content">
								<!-- 余额支付 -->
								<view class="center-box">
									<view class="left-logo">
										<image :src="yeImg"></image>
									</view>
									<view class="center-title">
										<text>余额</text>
									</view>
									<view class="right-radio">
										<radio color="rgba(7, 193, 96, 1)" value="ye"></radio>
									</view>
								</view>
								<!-- 微信支付 -->
								<!-- <view class="center-box">
									<view class="left-logo">
										<image :src="wxImg"></image>
									</view>
									<view class="center-title">
										<text>微信</text>
									</view>
									<view class="right-radio">
										<radio color="rgba(7, 193, 96, 1)" value="wx"></radio>
									</view>
								</view> -->
								<!-- 支付宝支付 -->
								<view class="center-box">
									<view class="left-logo">
										<image :src="zfbImg"></image>
									</view>
									<view class="center-title">
										<text>支付宝</text>
									</view>
									<view class="right-radio">
										<radio color="rgba(7, 193, 96, 1)" value="zfb"></radio>
									</view>
								</view>
							</view>
						</radio-group>
					</view>

					<view class="bottom">
						<view class="btn" @click="paymentOrderClick">
							<text>确定支付</text>
						</view>
					</view>
				</view>
			</template>
		</my-animation>
	</view>
</template>

<script>
	import myAnimation from '@/components/common/my-animation/my-animation.vue'

	export default {
		props: ['share', 'orderAllPrice'],
		data() {
			return {
				removeImg: require('@/static/img/common/remove_fff.svg'),
				height: '800',

				wxImg: require('@/static/img/main/home/details/wx.svg'),
				zfbImg: require('@/static/img/main/home/details/zfb.svg'),
				yeImg: require('@/static/img/main/home/details/ye.svg'),

				paymentMode: ''
			}
		},
		components: {
			myAnimation
		},
		methods: {
			display() {
				this.$emit('display')
			},
			changeRadio(e) {
				//console.log(e.detail.value)
				this.paymentMode = e.detail.value
			},
			//订单支付
			paymentOrderClick() {
				if (this.paymentMode == '' || this.paymentMode == null) {
					return uni.$showMsg('请选择支付方式');
				}
				//订单处理
				this.$emit('paymentOrderClick', this.paymentMode)
				//this.paymentOrderClick

			}
		}
	}
</script>

<style lang="scss" scoped>
	.top {
		.remove {
			text-align: center;
			width: 50rpx;
			height: 50rpx;
			border-radius: 50%;
			background-color: rgba(0, 0, 0, 0.3);
			margin-top: 20rpx;
			margin-left: 30rpx;

			image {
				margin-top: 10rpx;
				width: 30rpx;
				height: 30rpx;
			}
		}

		.price {
			height: 120rpx;
			line-height: 120rpx;
			width: 100%;
			text-align: center;

			.bq {
				font-size: 36rpx;
				font-weight: 500;
				color: rgba(0, 0, 0, 1);
			}

			.price-text {
				font-size: 50rpx;
				font-weight: 700;
				color: rgba(0, 0, 0, 1);
			}
		}
	}

	.center {
		width: 100%;

		.center-box {
			width: 94%;
			margin-left: 3%;
			display: flex;
			height: 100rpx;
			border: 1rpx solid rgba(229, 229, 229, 1);
			border-radius: 30rpx;
			margin-bottom: 20rpx;

			.left-logo {
				width: 20%;
				text-align: center;

				image {
					margin-top: 20rpx;
					width: 60rpx;
					height: 60rpx;
				}
			}

			.center-title {
				width: 60%;
				line-height: 100rpx;

				text {}
			}

			.right-radio {
				width: 20%;
				line-height: 100rpx;
				text-align: center;
			}
		}
	}

	.bottom {
		position: fixed;
		bottom: 0;
		left: 0;
		height: 120rpx;
		width: 100%;

		.btn {
			margin-left: 10%;
			height: 80rpx;
			line-height: 80rpx;
			text-align: center;
			width: 80%;
			background-color: rgba(67, 207, 124, 1);
			border-radius: 50rpx;

			text {
				font-size: 30rpx;
				font-weight: 400;
				color: rgba(255, 255, 255, 1);
			}
		}

	}
</style>
